<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8"/>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>

    <script>
        window.webkit = {
            messageHandlers: {
                invokeHandler: {
                    postMessage: function (info) {
//                        console.log(info);
                    }
                },
                publishHandler: {
                    postMessage: function (info) {
//                        console.log(info);
                    }
                }
            }
        }
        WeixinJSCore = {
            publishHandler: function () {

            },
            invokeHandler: function () {

            }
        }
    </script>
    <script>
        var __webviewId__;
    </script>
    <script>
        __wxRoute = 'index';
        __wxRouteBegin = true;
        __wxConfig = {
            "debug": true,
            "pages": ["index"],
            "window": {
                "backgroundTextStyle": "light",
                "navigationBarBackgroundColor": "#fff",
                "navigationBarTitleText": "WeChat",
                "navigationBarTextStyle": "black"
            },
            "projectConfig": {
                "Network": {
                    "RequestDomain": [],
                    "WsRequestDomain": [],
                    "UploadDomain": [],
                    "DownloadDomain": []
                },
                "Setting": {
                    "MaxLocalstorageSize": 10,
                    "MaxCodeSize": 5,
                    "MaxWebviewDepth": 5,
                    "MaxBackgroundLifespan": 300,
                    "MaxRequestConcurrent": 5,
                    "MaxUploadConcurrent": 1,
                    "MaxDownloadConcurrent": 5
                },
                "appid": "touristappid"
            },
            "appserviceConfig": {
                "AppserviceMaxDataSize": 1048576,
                "HTTPSetting": {
                    "HTTPHeaderMode": "BlackList",
                    "HeaderBlackList": ["User-Agent"],
                    "HeaderWhiteList": [],
                    "UploadMaxTimeoutMS": 60000,
                    "DownloadMaxTimeoutMS": 60000,
                    "WebsocketMaxTimeoutMS": 60000,
                    "RequestMaxTimeoutMS": 60000,
                    "HTTPHeaderReferer": "servicewechat.com"
                },
                "CDNBaseURL": "https://res.wx.qq.com/weapp",
                "AppMaxRunningCount": 5
            },
            "appname": "fdfaf",
            "appid": "touristappid",
            "apphash": 2107567080,
            "isTourist": true,
            "userInfo": {}
        }
    </script>
    <script src="./split/wxJSBridge.js"></script>
    <script src="./split/virtual_dom.js"></script>
    <script src="./split/report.js"></script>
    <script src="./split/exparser.js"></script>
    <script src="./split/exparser-behavior.js"></script>
    <script src="./split/define.js"></script>

    <script src="./split/wx.js"></script>
    <script src="./split/page.js"></script>

    <!--{{allWXML}}-->
    <!--{{eruda}}-->
    <!--{{style}}-->
    <!--{{currentstyle}}-->
    <!--{{generateFunc}}-->
    <script src="./build/index.js"></script>
    <link rel="stylesheet" href="./build/index.css">
</head>

<body>
<div id="app"></div>
</body>
<script>
    define("app.js", function (require, module) {
        var window = {Math: Math}/*兼容babel*/, location, document, navigator, self, localStorage, history, Caches;
        App({
            onLaunch: function () {
                this.globalData.motto = 'hello';
            },
            globalData: {
                userInfo: {
                    nickName: 'Phodal',
                    avatarUrl: 'http://wx.qlogo.cn/mmhead/Q3auHgzwzM7pIm6FdyB5rlkI0JCr9uOr8n7aCIQ4RsyG0oPeicO9pfQ/132'
                },
                motto: 'hello,world'
            }
        })
    });
    require("app.js");

    define("pages/index/index.js", function (require, module) {
        var window = {Math: Math}/*兼容babel*/, location, document, navigator, self, localStorage, history, Caches;
        var app = getApp();
        Page({
            data: {
                motto: 'Hello World',
                userInfo: {}
            },
            //事件处理函数
            bindViewTap: function () {
                wx.navigateTo({
                    url: '../logs/logs'
                })
            },
            onLoad: function () {
                console.log('onLoad')
                var that = this
                //调用应用实例的方法获取全局数据
                app.getUserInfo(function (userInfo) {
                    //更新数据
                    that.setData({
                        userInfo: userInfo
                    })
                })
            }
        })

    });
    require("pages/index/index.js");

    document.addEventListener("DOMContentLoaded", function () {
        console.log("start");
        document.dispatchEvent(new CustomEvent("generateFuncReady", {
            detail: {
                generateFunc: $gwx('src/index.wxml')
            }
        }))
    });
</script>
</html>
